<% layout('/layouts/default.html', {title: '任务部署信息表(主)管理', libs: ['validate','fileupload','dataGrid']}){ %>
<style>

</style>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa icon-note"></i> ${text(dcSupTaskInfo.isNewRecord ? '任务明细' : '任务明细')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${dcSupTaskInfo}" action="${ctx}/schebusitaskinfo/dcSupTaskInfo/saveTask" method="post" class="form-horizontal">
		<div class="box-body">
			<#form:hidden path="id"/>
			<div class="row">
				<div class="form-unit">${text('基本信息')}</div>
				<!--基本任务信息-->
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('任务年度')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label">${dcSupTaskInfo.taskYear}年</label>
							</div>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('任务类型')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<label class="control-label">${dcSupTaskInfo.taskTypeName}</label>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('任务标题')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<label class="control-label" style="text-align: left">${dcSupTaskInfo.taskTitle}</label>
							</div>
						</div>
					</div>
				</div>

				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('任务内容')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<label class="control-label" style="text-align: left">${dcSupTaskInfo.taskContent}</label>
							</div>
						</div>
					</div>

				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">
								<span class="required hide">*</span> ${text('附件上传')}：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadFile" bizKey="${dcSupTaskInfo.id}" bizType="dcSupTaskInfo_file"
								uploadType="all" class="" readonly="true" preview="true" readonly="true"/>
							</div>
						</div>
					</div>
				</div>

				<div class="form-unit progressInfo">${text('流程走向')}</div>

				<div class="form-unit showInfo">${text('最新进展')}</div>
				<!--添加分解信息-->



			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="button" class="btn btn-sm btn-primary" onclick=clickTwo('${dcSupTaskInfo.id}','${taskLeader}','${explainContent}')> ${text('批示')}</button>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>

<script>

	var content_ = `${dcSupTaskInfoArrange.arrangeContent}`
	var content_2 = `${dcSupTaskInfoArrange.arrangeContent2}`
	var content_3 = `${dcSupTaskInfoArrange.arrangeContent3}`
	if(content_){
	// log(content_)
	var html =
	         "\t\t\t\t<!--基本任务信息-->\n" +
					"\t\t\t\t<div class=\"row\">\n" +
					"\t\t\t\t\t<div class=\"col-xs-12\">\n" +
					"\t\t\t\t\t\t<div class=\"form-group\">\n" +
			"\t\t\t\t\t\t\t<label class=\"control-label col-sm-2\" title=\"\">\n" +
			"\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 最新进展情况：<i class=\"fa icon-question hide\"></i></label>\n" +
					"\t\t\t\t\t\t\t<div class=\"col-sm-10\">\n" +
					"\t\t\t\t\t\t\t\t<label class=\"control-label\"><span style=\"text-align:left;display: block;white-space: pre-line;\">"+content_+"</span></label>\n" +
					"\t\t\t\t\t\t\t</div>\n" +
					"\t\t\t\t\t\t</div>\n" +
					"\t\t\t\t\t</div>\n" +
					"\t\t\t\t\t</div>\n"+
		"\t\t\t\t<!--基本任务信息-->\n" +
		"\t\t\t\t<div class=\"row\">\n" +
		"\t\t\t\t\t<div class=\"col-xs-12\">\n" +
		"\t\t\t\t\t\t<div class=\"form-group\">\n" +
		"\t\t\t\t\t\t\t<label class=\"control-label col-sm-2\" title=\"\">\n" +
		"\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 存在问题：<i class=\"fa icon-question hide\"></i></label>\n" +
		"\t\t\t\t\t\t\t<div class=\"col-sm-10\">\n" +
		"\t\t\t\t\t\t\t\t<label class=\"control-label\"><span style=\"text-align:left;display: block;white-space: pre-line;\">"+content_2+"</span></label>\n" +
		"\t\t\t\t\t\t\t</div>\n" +
		"\t\t\t\t\t\t</div>\n" +
		"\t\t\t\t\t</div>\n" +
		"\t\t\t\t\t</div>\n"+
			"\t\t\t\t<!--基本任务信息-->\n" +
			"\t\t\t\t<div class=\"row\">\n" +
			"\t\t\t\t\t<div class=\"col-xs-12\">\n" +
			"\t\t\t\t\t\t<div class=\"form-group\">\n" +
			"\t\t\t\t\t\t\t<label class=\"control-label col-sm-2\" title=\"\">\n" +
			"\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> 拟采取的工作举措：<i class=\"fa icon-question hide\"></i></label>\n" +
			"\t\t\t\t\t\t\t<div class=\"col-sm-10\">\n" +
			"\t\t\t\t\t\t\t\t<label class=\"control-label\"><span style=\"text-align:left;display: block;white-space: pre-line;\">"+content_3+"</span></label>\n" +
			"\t\t\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t</div>\n"

	$('.showInfo').after(html)}
$(function () {
	var progressStatus = ${processStatus}
	if(progressStatus=='1'){
		progressStatus =	'<img src="${ctxStatic}/m/images/4-1.png"></a>';
	}else if(progressStatus=='2'){
		progressStatus ='<img src="${ctxStatic}/m/images/4-2.png"></a>';
	} else if(progressStatus=='3'){
		progressStatus ='<img src="${ctxStatic}/m/images/4-3.png"></a>';
	} else if(progressStatus=='4'){
		progressStatus= '<img src="${ctxStatic}/m/images/4-4.png"></a>' ;
	}else{
		progressStatus= '未知';
	}

	var progressHtml =         "\t\t\t\t<!--基本任务信息-->\n" +
			"\t\t\t\t<div class=\"row\">\n" +
			"\t\t\t\t\t<div class=\"col-xs-12\">\n" +
			"\t\t\t\t\t\t<div class=\"form-group\">\n" +
			"\t\t\t\t\t\t\t<label class=\"control-label col-sm-2\" title=\"\">\n" +
			"\t\t\t\t\t\t\t\t<span class=\"required hide\">*</span> <i class=\"fa icon-question hide\"></i></label>\n" +
			"\t\t\t\t\t\t\t<div class=\"col-sm-10\">\n" +
			"\t\t\t\t\t\t\t\t<label class=\"control-label\"><span style=\"text-align:left;display: block;cursor:pointer;white-space: pre-line;\" onclick=\"clickImage()\" >"+progressStatus+"</span></label>\n" +
			"\t\t\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t</div>\n" +
			"\t\t\t\t\t</div>\n"+
			"\t\t\t\t<!--基本任务信息-->\n"

	$('.progressInfo').after(progressHtml)
})
function clickImage(){
	js.layer.open({
		type: 2,
		title: [''],
		area: ['800px', '500px'],
		scrollbar: true,
		shadeClose: false,
		content: "${ctx}/home/homePage/getImageList?id=${dcSupTaskInfo.id}",
		btn1: function (index, layero) {
		},
		end:function () {
		}
	});
}

	// 批示
	function clickTwo(id,taskLeader,explainContent){
		if(explainContent == "undefined"){
			explainContent = "";
		}
		explainContent =encodeURIComponent(explainContent);
		js.layer.open({
			type: 2,
			title: ['领导批示'],
			area: ['800px', '500px'],
			scrollbar: true,
			shadeClose: false,
			content: "${ctx}/home/homePage/formExplain?actionId="+id+"&explainCode="+taskLeader+"&explainContent="+explainContent,
			btn1: function (index, layero) {
			},
			end:function () {
				$('#dataGrid').dataGrid('refresh', 1, 20);
				//  $('#dataGrid2').dataGrid('refresh', 1, 20);
			}
		});
	}
</script>
